package com.ebao.po.blog;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.ebao.constants.UserType;

/**
 * @desc 博客分类，日志分类
 * 
 * 每个人都有一个默认分类，将某类别删除时，该类别下的博客自动转为默认分类分类下
 * 
 * @author snow
 * @date 2012-7-10
 */
@Entity
@Table(name = "T_Blog_Classify")
public class TBlogClassify implements Serializable {

	private static final long serialVersionUID = 304452324525765970L;
	
	private Long id;
	private UserType blogerType;	// 博主类型user/doctor
	private String blogerId;		// 博主Id
	private String Classifying;		// 分类
	private String createDate;		// 分类建立的日期
	private List<TBlog> blogs = new ArrayList<TBlog>();		// 该分类下的博客

	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public UserType getBlogerType() {
		return blogerType;
	}

	public void setBlogerType(UserType blogerType) {
		this.blogerType = blogerType;
	}

	public String getBlogerId() {
		return blogerId;
	}

	public void setBlogerId(String blogerId) {
		this.blogerId = blogerId;
	}

	public String getClassifying() {
		return Classifying;
	}

	public void setClassifying(String classifying) {
		Classifying = classifying;
	}

	@OneToMany(mappedBy = "blogClassify", targetEntity = TBlog.class)
	public List<TBlog> getBlogs() {
		return blogs;
	}

	public void setBlogs(List<TBlog> blogs) {
		this.blogs = blogs;
	}

	@Column(length = 19)
	public String getCreateDate() {
		return createDate;
	}

	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}

}
